namespace AdmissionQA.Domain.Entities;

/// <summary>
/// 招生政策实体
/// </summary>
public class AdmissionPolicy : EntityBase
{
    /// <summary>
    /// 政策名称
    /// </summary>
    public string AdmissionPolicyName { get; private set; }

    /// <summary>
    /// 政策正文
    /// </summary>
    public string AdmissionPolicyContent { get; private set; }

    /// <summary>
    /// 向量化Embedding字段
    /// </summary>
    public float[]? Embedding { get; set; }

    /// <summary>
    /// 构造函数
    /// </summary>
    private AdmissionPolicy(
        string admissionPolicyName,
        string admissionPolicyContent,
        string? description
    )
    {
        AdmissionPolicyName = admissionPolicyName;
        AdmissionPolicyContent = admissionPolicyContent;
        Description = description;
    }

    /// <summary>
    /// 创建招生政策
    /// </summary>
    public static AdmissionPolicy? CreateAdmissionPolicy(
        string admissionPolicyName,
        string admissionPolicyContent,
        string? description
    )
    {
        // 可以加入一些条件判断

        return new AdmissionPolicy(admissionPolicyName, admissionPolicyContent, description);
    }

    /// <summary>
    /// 更新招生信息
    /// </summary>
    public bool UpdateAdmissionPolicy(
        string newAdmissionPolicyName,
        string newAdmissionPolicyContent,
        string? newDescription
    )
    {
        // 可以加入一些条件判断

        AdmissionPolicyName = newAdmissionPolicyName;
        AdmissionPolicyContent = newAdmissionPolicyContent;
        Description = newDescription;
        return true;
    }
}
